<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="{$url}public/js/googleAuto/lib/jquery.autocomplete_geomod.js"></script>
<script type="text/javascript" src="{$url}public/js/googleAuto/geo_autocomplete.js"></script> 
<link rel="stylesheet" type="text/css" href="{$url}public/js/googleAuto/lib/jquery.autocomplete.css" />
{literal}
<script type="text/javascript">
var siteAddress = "{/literal}{$site_address}{literal}";
jQuery(document).ready(function() {
    var data = "{/literal}{$autoData}{literal}".split(",");
    $("#kogo_szukasz").autocomplete(data);
    $('#location').geo_autocomplete(new google.maps.Geocoder, {
        mapkey: 'ABQIAAAAHy-4chTxWi7fRAXj5xfkGRTVeRltro6I6Asm8fjVGF4U7FNUOBQyKduIHYGVXdJcpJrs6BUDWFe7Wg', 
        selectFirst: false,
        minChars: 3,
        cacheLength: 50,
        width: 300,
        scroll: true,
        scrollHeight: 330
    }).result(function(_event, _data) {
    });
    sosjob.startPricesSliders();
    $('#showAdvancedInput').click(function(){
        $('#advancedOptionsLi').toggle();
    });
});
</script>
{/literal}

				<div id="szukajMainContent">
					<form method="post" action="{$url}znajdz-osobe">
                        <ul class="listSearchForm">
                            <li>
                                <input id="kogo_szukasz" class="searchSmallInput" type="text" name="lookingPerson" value="{$lookingPerson}" />  
                            </li>
                            <li>
                                <input class="searchSmallInput ac_input" type="text" id="location" name="address" value="{$address}" type="text" autocomplete="off"/>
                            </li>
                            <li>
                                <select name="when" id="whenWork" onchange="javascript: changeWhenWork();">
                                    <option value="na dziś">na dziś</option>
                                    <option value="na jutro">na jutro</option>
                                    <option value="za 2 dni">za 2 dni</option>
                                    <option value="za 3 dni">za 3 dni</option>
                                    <option value="za tydzień">za tydzień</option>
                                </select>
                            </li>
                            <li>
                                <input class="buttonActionMain ml-20" type="submit" name="search" value="Szukaj" />
                            </li>
                            <li id="advancedOptShow">
                                <label id="spanAdvancedOpt" for="showAdvancedInput">zaawansowane</label>
                                <input {if isset($post.showAdvancedInput)}checked="checked"{/if} type="checkbox" id="showAdvancedInput" name="showAdvancedInput"/>
                            </li>
                            <li id="advancedOptionsLi" {if not isset($post.showAdvancedInput)} style="display: none;"{/if}>
                                <div id="searchOptAdvanced">
                                    <table>
                                        <tr>
                                            <td>
                                                <input {if isset($post.optCompany)}checked="checked"{/if} type="checkbox" name="optCompany" id="optComapny" />
                                                <label for="optComapny" class="searchLabel">Firma</label>
                                            </td>
                                            <td>
                                                <div class="sliderSearchContainer">
                                                    <p class="sliderSearchPar">
                                                        <label class="searchLabel">Stawka maksymalna za godzinę:</label>
                                                        <input type="text" readonly="readonly" id="searchPerHour" name="searchPerHour" class="rangeValue" value="" />
                                                        <span class="searchLabel">zł</span>
                                                    </p>
                                                    <div id="sliderPerHour"></div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input {if isset($post.optPerson)}checked="checked"{/if} type="checkbox" name="optPerson" id="optPerson" />
                                                <label for="optPerson" class="searchLabel">Osoba prywatna</label>
                                            </td>
                                            <td>
                                                <div class="sliderSearchContainer">
                                                    <p class="sliderSearchPar">
                                                        <label class="searchLabel">Stawka maksymalna za uslugę:</label>
                                                        <input type="text" readonly="readonly" id="searchPerService" name="searchPerService" class="rangeValue" />
                                                        <span class="searchLabel">zł</span>
                                                    </p>
                                                    <div id="sliderPerService"></div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </li>
                            <li style="display: none;">
                                <input type="hidden" id="postPricePerHour" value="{if isset($post.searchPerHour)}{$post.searchPerHour}{/if}" />
                                <input type="hidden" id="postPricePerService" value="{if isset($post.searchPerService)}{$post.searchPerService}{/if}" />
                            </li>
                        </ul>
					</form>
					<div id="map_canvas">
					</div>
					<a id="pokaz_w_siatce" href="javascript:;" title="Pokaż w siatce">Pokaż w siatce &raquo;</a>
					<ul class="oferty">
                        {literal}
                        <script type="text/javascript">
                            if (GBrowserIsCompatible()) 
                                    {
                                        var map = new GMap2(document.getElementById("map_canvas"));
                                        var burnsvilleMN = new GLatLng({/literal}{$pLat}{literal}, {/literal}{$pLon}{literal}); 
                                        map.setCenter(burnsvilleMN, 12);  
                                        map.addControl(new GLargeMapControl());
                                        map.addControl(new GOverviewMapControl()); 
                                        map.addControl(new GScaleControl());
                                        map.addControl(new GLargeMapControl());        
                                        map.addControl(new GMapTypeControl());
                                 
                                        var bounds = map.getBounds();
                                        var southWest = bounds.getSouthWest();
                                        var northEast = bounds.getNorthEast();
                                        var lngSpan = northEast.lng() - southWest.lng();
                                        var latSpan = northEast.lat() - southWest.lat();
                                        
                                        var searchMarkers = [];
                                        for(i=1; i<100; i++)
                                        {
                                            searchMarkers.push(i);
                                        }
                                 }
                                 var markerIconAddr = new GIcon(G_DEFAULT_ICON);
                                 markerIconAddr.image = siteAddress + "public/icons/markers/blueNormalFont/blank.png";
                                 markerOptionsAddr = {icon: markerIconAddr};
                                 var markerAddr = new GMarker(burnsvilleMN, markerOptionsAddr);
                                 map.addOverlay(markerAddr);
                                 GEvent.addListener(markerAddr, "click", function()
                                    {
                                        $('<div>Twoja lokalizacja<div>').dialog({
                                            buttons: {'ok': function(){$(this).dialog("close");}},
                                            resizable: false
                                        })
                                    });
                                </script>
                        {/literal}
                        {if $workers}
                        <form style="margin: 0px;" action="{$url}wyslij-smsy" name="sendAllSms" method="post"> 
                        <input type="hidden" name="lookingPerson" value="{$lookingPerson}"/> 
                        <input type="hidden" name="address" value="{$address}"/> 
                        <input type="hidden" name="phone" value="" id="singlePhone"/> 
                        <input type="hidden" name="when" id="wheneWorkForm" value="na dziś"/>                 
                        {foreach from=$workers item=value name="searchW"}
                            {literal}
                                <script type="text/javascript">
                                        var point = new GLatLng({/literal}{$value.lat}{literal},{/literal}{$value.lon}{literal});
                                        var markerIcon = new GIcon(G_DEFAULT_ICON);
                                        var markerColor;
                                        {/literal}{if $value.company_name neq ""}{literal}
                                            markerColor = "redNormalFont";
                                        {/literal} {else} {literal}
                                            markerColor = "yellowNormalFont";
                                       {/literal}  {/if} {literal}
                                        markerIcon.image = siteAddress + "public/icons/markers/"+markerColor+"/marker"+ {/literal}{$value.markerOrder}{literal} + ".png";
                                        var markerOptions = {icon: markerIcon};
                                        var marker = new GMarker(point, markerOptions);
                                        searchMarkers[{/literal}{$value.id}{literal}] = marker;
                                        marker.id = "markerMap_"+{/literal}{$value.id}{literal};
                                        GEvent.addListener(marker, "click", function()
                                        {
                                            {/literal}{if $value.company_name neq ""}{literal}
                                                showWholeDescription('{/literal}{$value.description}{literal}', '{/literal}{$value.name}{literal}', '{/literal}{$value.price_per_hour}{literal}', '{/literal}{$value.price_per_service}{literal}', '{/literal}Tak({$value.company_name}){literal}');
                                            {/literal} {else} {literal} 
                                                showWholeDescription('{/literal}{$value.description}{literal}', '{/literal}{$value.name}{literal}', '{/literal}{$value.price_per_hour}{literal}', '{/literal}{$value.price_per_service}{literal}', '{/literal}Nie(Osoba prywatna){literal}');
                                           {/literal}  {/if} {literal} 
                                        }); 
                                        countOfSms +=1;   
                                        map.addOverlay(marker);
                                </script>
                            {/literal}
                            <li id="workers_{$value.id}" class="s1 mb-10">
                                {if $value.company_name neq ""}
                                    <a style="background: url('public/icons/markers/redNormalFont/marker{$value.markerOrder}.png') no-repeat" class="companyStar" href="javascript:;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Tak({$value.company_name})')" title="{$value.description|truncate:50:"..."}">{$value.description|truncate:50:"..."}</a>
                                {else}
                                    <a style="background: url('public/icons/markers/yellowNormalFont/marker{$value.markerOrder}.png') no-repeat" href="javascript:;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Nie(Osoba prywatna)')" title="{$value.description|truncate:50:"..."}">{$value.description|truncate:50:"..."}</a>
                                {/if}
                                <input type="hidden" name="ids[]" value="{$value.id}" />
                                <span class="fRight fs-12 fw-b c-po" onclick="removeWorker('workers_{$value.id}', '{$value.id}')">usuń</a>
                            </li>
                        {/foreach}
                        </form>
                        {/if}
					</ul>
                    <input type="button" class="buttonActionMain" onclick="$('#slideContainer').trigger('click');" value="wyślij smsy" style="margin-top: 15px; margin-right: 46px;"/> 
				</div>
				<div id="reasonMainContent" style="display: none;">
                            <h1>Oferty</h1>
                            <a id="back_to_search" href="" title="Powrót do wyszukiwarki">Powrót do wyszukiwarki</a>
                            <ul id="oferty">
                                {foreach from=$marge item=mar name="foo"}
                                    {foreach from=$mar item=value}
                                            <li id="net_{$value.id}" class="s{$smarty.foreach.foo.iteration}" >
                                        {if $value.company_name neq ""}
                                            <div style="cursor: pointer;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Tak({$value.company_name}){$offerType}')">
                                        {else}
                                            <div style="cursor: pointer;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Nie(Osoba prywatna)')">
                                        {/if}
                                            <h2>
                                                <a title="">{$value.name} {$value.surname|truncate:1:"..."}</a>
                                            </h2>
                                            <p>
                                                {$value.description|truncate:100:"..."}
                                            </p>
                                        </div>
                                        <div class="gridBottomMarker" onclick="test">
                                            {if $value.company_name neq ""}
                                                <img src="public/icons/markers/redNormalFont/marker{$value.markerOrder}.png" alt="" />
                                            {else}
                                                <img src="public/icons/markers/yellowNormalFont/marker{$value.markerOrder}.png" alt="" />
                                            {/if}
                                            <input type="checkbox" checked="checked" style="border: 1px solid gray" />
                                        </div>
                                        <div class="gridBottomLinks">
                                            {if $value.company_name neq ""}
                                                <span class="gridBottomLinkShow" style="cursor: pointer;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Tak({$value.company_name}){$offerType}')">zobacz &raquo;</span>
                                            {else}
                                                <span class="gridBottomLinkShow" style="cursor: pointer;" onclick="showWholeDescription('{$value.description}', '{$value.name}', '{$value.price_per_hour}', '{$value.price_per_service}', 'Nie(Osoba prywatna)')">zobacz &raquo;</span>
                                            {/if}
                                            <a class="f-left fw-b fs-12" href="javascript:;" onclick="removeWorker('workers_{$value.id}', '{$value.id}')" title="zobacz">usuń</a>
                                        </div>
                                     {/foreach}
                                </li>    
                                {/foreach}
                            </ul>
                            <div id="paginate">
                                <ol>
                                    <li class="prev">
                                        <a href="" title="Poprzednia stona"></a>
                                    </li>
                                    {foreach from=$marge item=value name=pag}
                                    <li class="s{$smarty.foreach.pag.iteration}">
                                        <a class="{if $smarty.foreach.pag.iteration eq 1}active{/if}" href="javascript:;" title="">{$smarty.foreach.pag.iteration}</a>
                                    </li>
                                    {/foreach}
                                    <li class="next">
                                        <a href="" title="Następna strona"></a>
                                    </li>
                                </ol>
                            </div>
                        </div>